{% extends "base.html" %}
{% block content_header %}
<h1>应用管理</h1>
{% endblock %}
{% block content_body %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="callout callout-warning">
    <ul>
        {% for message in messages %}
        <li><h4>{{ message }}</h4></li>
        {% endfor %}
    </ul>
</div>
{% endif %}
{% endwith %}
    <div class="box">
            <div class="box-header">
              <h3 class="box-title">应用列表</h3>
            </div>
            <div class="box-body">
                <div class="row">
               {% for app in app_list %}

  <div class="col-xs-6 col-md-3">
    <a href="/app/page/{{  app.id  }}" class="thumbnail">
      <img src="{{  app.app_icon  }}" alt="{{ app.app_name}}">
    </a>
  </div>
                </div>
                {% endfor %}
                <a class="btn btn-app" data-toggle="modal" data-target="#app-create-modal"><i class="fa fa-plus"></i>添加应用</a>
    </div>
    </div>
     <div class="modal fade" role="dialog" id="app-create-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <form action="/app/create" method="post">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">×</span></button>
                        <h4 class="modal-title">添加应用</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="app_id">app_id</label>
                            <input type="text" name="app_id" id="app_id" class="form-control"
                                   placeholder="app_id">
                        </div>
                        <div class="form-group">
                            <label for="app_name">应用名称</label>
                            <input type="text" name="app_name" id="app_name" class="form-control"
                                   placeholder="应用名称">
                        </div>
                                    <div class="form-group">
                            <label for="app_icon">应用图标</label>
                            <input type="text" name="app_icon" id="app_icon" class="form-control">
                        </div>

                                    <div class="form-group">
                            <label for="package_name">package_name</label>
                            <input type="text" name="package_name" id="package_name" class="form-control" >
                        </div>

                                    <div class="form-group">
                            <label for="package_code">package_code</label>
                            <input type="text" name="package_code" id="package_code" class="form-control">
                        </div>

                                    <div class="form-group">
                            <label for="package_sort">package_sort</label>
                            <input type="text" name="package_sort" id="package_sort" class="form-control">
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary">添加</button>
                    </div>
                </form>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->

    </div>
{% endblock %}

